package day3;

import java.util.Arrays;

public class Test3 {
    public static void main(String[] args) {
        //数组工具类
        int[] arr = {1,3,5,2,6,8};
        //输出数组元素
        System.out.println(Arrays.toString(arr));

        //数组的复制
        arr = Arrays.copyOf(arr, 10);
        System.out.println(Arrays.toString(arr));

        //排序
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));

        //fill
        Arrays.fill(arr, 10);
        System.out.println(Arrays.toString(arr));

        //二分查找
        int[] arr2 = {1,3,5,2,6,8,2};
//        Arrays.sort(arr2);
//        System.out.println(Arrays.toString(arr2));
        int num = Arrays.binarySearch(arr2, 200);
        System.out.println("下标为："+num);

        //指定位置复制
        int newAyy[] = Arrays.copyOfRange(arr2, 1, 10);
        System.out.println(Arrays.toString(newAyy));
    }
}
